{include file='_header'}
<style>
    .multi-item {margin-bottom: 18px;}
</style>
<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}商品组 <small>{if !empty($item)}(名称: {$item['name']}){/if}</small></span>
</div>

<div class="page-content">
    <form action="" method="post" class="form-validate form-horizontal ">
        <div class="form-group">
            <label class="col-lg control-label">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{$item['displayorder']}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">商品组名称</label>
            <div class="col-sm-9">
                <input type="text" class="form-control valid" name="name" value="{$item['name']}" data-rule-required="true" placeholder="请输入商品组名称" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">商品组状态</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="1" {if $item['enabled']==1}checked="checked"{/if}> 启用
                </label>
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="0" {if $item['enabled']==0 || empty($item)}checked="checked"{/if}> 禁用
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">组内商品</label>
            <div class="col-sm-9">
                <div class="form-group" style="height: auto; display: block;">
                    <div class="col-sm-12 col-xs-12">
                        {:tpl_selector('goodsids',array('preview'=>true,'readonly'=>true, 'required'=>'true', 'multi'=>1,'url'=>url('admin/goods/query'),'items'=>$goods,'buttontext'=>'选择商品','placeholder'=>'请选择商品'))}
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="{:url('admin/goods/group')}">返回列表</a>
            </div>
        </div>

    </form>
</div>

<script language="javascript">
    require(['jquery.ui'],function(){
        $('.multi-img-details').sortable();
    })
</script>

{include file='_footer'}